package engine;

public class ResultEntry implements Comparable<ResultEntry> {

    private String filePath;
    private Double score;
    private String corpusPath;

    public ResultEntry(String filePath, Double score, String corpusPath) {
        this.filePath = filePath;
        this.score = score;
        this.corpusPath = corpusPath;
    }

    public String getFilePath() {
        return filePath;
    }

    public Double getScore() {
        return score;
    }

    public String getCorpusPath() {
        return corpusPath;
    }

    @Override
    public int compareTo(ResultEntry o) {
        if (this.score > o.score) {
            return 1;
        } else if (this.score < o.score) {
            return -1;
        } else {
            return 0;
        }
    }

    @Override
    public String toString() {
        return score + " ; " + filePath.replace(corpusPath, "<corpusPath>");
    }
}
